import {type FC } from "react"
import { Typography } from "antd"
import type { QuestionTitlePropsType } from "@/utils/type"
import { defaultTitleProps } from "@/utils/default"

const {Title} = Typography





const QuestionTitle:FC<QuestionTitlePropsType> = (props: QuestionTitlePropsType)=>{

  const {text = '',level = 1 , isCenter = false} = {...defaultTitleProps,...props}

  const getFontSize = (level: 1|2|3) => {
      if(level === 1) return '20px'
      else if(level === 2) return '18px'
      else if(level === 3) return '16px'
      return '16px'
  }


  return (
    <Title  level={level} style={{fontSize: getFontSize(level),textAlign: isCenter ? 'center' : 'left'}}>
      {text}
    </Title>
  )
}




export default QuestionTitle;